﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Wicresoft.RDW.Utility;

namespace Wicresoft.RDW
{
    public partial class Error :BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Exception exception = Context.Server.GetLastError();

            if (exception != null)
            {
                string errorInfo =
                   "<br/>Offending URL: " + Request.Url.ToString() +
                   "<br/>Source: " + exception.Source +
                   "<br/>Message: " + exception.Message +
                   "<br/>Stack trace: " + exception.StackTrace;

                lblMessage.Text = errorInfo;

                if (exception.InnerException != null)
                    errorInfo = exception.InnerException.Message;
                else
                    errorInfo = exception.Message;
                Logger.Error(errorInfo, exception);

                Server.ClearError();
            }
        }

        public override Utility.Language Language
        {
            get
            {
                return Utility.Language.CN;
            }
            set
            {
                base.Language = value;
            }
        }
    }
}